home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Information / Digests / CSMP Digest / volume 1 / csmp-v1-212.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  45.9 KB  |  1,156 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Wed, 11 Nov 92       Volume 1 : Issue 212
  2.  
  3. Today's Topics:
  4.  
  5.     Regular Expressions
  6.     Another Sound Manager Question (recording on PB)
  7.     Deferred Tasks - What can I do?
  8.     problem with my dialog filter
  9.     Apple Events! How to locate a service?
  10.  
  11.  
  12.  
  13. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  14.  
  15. The digest is a collection of article threads from the internet newsgroup
  16. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  17. regularly and want an archive of the discussions.  If you don't know what a
  18. newsgroup is, you probably don't have access to it.  Ask your systems
  19. administrator(s) for details.  (This means you can't post questions to the
  20. digest.)
  21.  
  22. Each issue of the digest contains one or more sets of articles (called
  23. threads), with each set corresponding to a 'discussion' of a particular
  24. subject.  The articles are not edited; all articles included in this digest
  25. are in their original posted form (as received by our news server at
  26. cs.uoregon.edu).  Article threads are not added to the digest until the last
  27. article added to the thread is at least one month old (this is to ensure that
  28. the thread is dead before adding it to the digest).  Article threads that
  29. consist of only one message are generally not included in the digest.
  30.  
  31. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  32. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  33. file /pub/mac/csmp-digest/README before downloading any files.  The most
  34. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  35. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  36. archive has a mail server; send a message with the text '$MACarch help' (no
  37. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  38.  
  39. The digest is also available via email.  Just send a note saying that you
  40. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  41. automatically receive each new issue as it is created.  Sorry, back issues
  42. are not available through the mailing list.
  43.  
  44. Send administrative mail to mkelly@cs.uoregon.edu.
  45.  
  46.  
  47. -------------------------------------------------------
  48.  
  49. From: rpd@hera.Sbi.Com (Richard P. Daley)
  50. Subject: Regular Expressions
  51. Date: 30 Sep 92 23:19:11 GMT
  52. Organization: Fulcrum - Salomon Brothers, NY
  53.  
  54. Does anyone know where I can find source code to implement searching through
  55. text for regular expressions?  I'm hoping to find something like re_comp()
  56. and re_exec() on the Sun.
  57.  
  58. +++++++++++++++++++++++++++
  59.  
  60. From: spencer@panix.com (David Spencer)
  61. Date: Thu, 1 Oct 1992 18:03:58 GMT
  62. Organization: PANIX Public Access Unix, NYC
  63.  
  64. In <1520@twinkletoes.hera.Sbi.Com> rpd@hera.Sbi.Com (Richard P. Daley) writes:
  65.  
  66. >Does anyone know where I can find source code to implement searching through
  67. >text for regular expressions?  I'm hoping to find something like re_comp()
  68. >and re_exec() on the Sun.
  69.  
  70. The gnu regular expression library is at prep.ai.mit. The version in
  71. the grep/egrep sources has been built and tested (for years) by
  72. wizards. The separate regex library is called beta, but it's an
  73. extended and rationalized version of the grep regex code.
  74.  
  75. It has bsd compatible calls, as well as its own comp/exec format.
  76.  
  77. The bsd regex code is on gatekeeper.dec.com.
  78.  
  79. You can also try the agrep code. It allows slightly more general
  80. searching than extended regular expressions. It's from University of
  81. Arizona; try archie to get the location.
  82.  
  83. dhs   spencer@panix.com
  84.  
  85.  
  86. +++++++++++++++++++++++++++
  87.  
  88. From: merlyn@ora.com (Randal L. Schwartz)
  89. Date: 2 Oct 92 06:36:59 GMT
  90. Organization: Stonehenge Consulting Services; Portland, Oregon, USA
  91.  
  92. In article <1992Oct1.180358.3460@panix.com> spencer@panix.com (David Spencer) writes:
  93.    The gnu regular expression library is at prep.ai.mit. The version in
  94.    the grep/egrep sources has been built and tested (for years) by
  95.    wizards. The separate regex library is called beta, but it's an
  96.    extended and rationalized version of the grep regex code.
  97.  
  98. Remember of course that this code is subject to the GNU Public
  99. License.  And because of RMS's opinions about Apple, you can bet that
  100. code for a Mac that uses these routines but violates the GPL would be
  101. prosecuted swiftly and painfully.
  102.  
  103.  
  104. - --
  105. Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
  106. merlyn@reed.edu (guest account) merlyn@ora.com (better for permanent record)
  107. cute quote: "Welcome to Portland, Oregon -- home of the California Raisins!"
  108.  
  109. +++++++++++++++++++++++++++
  110.  
  111. From: Reid Ellis <rae@Alias.com>
  112. Organization: Alias Research, Inc., Toronto ON Canada
  113. Date: Fri, 9 Oct 1992 19:11:33 GMT
  114.  
  115. David Spencer <spencer@panix.com> writes:
  116. |The gnu regular expression library is at prep.ai.mit. ... The separate
  117. |regex library is called beta, but it's an extended and rationalized
  118. |version of the grep regex code.
  119.  
  120. Randal L. Schwartz <merlyn@ora.com> writes:
  121. |Remember of course that this code is subject to the GNU Public
  122. |License.  And because of RMS's opinions about Apple, you can bet that
  123. |code for a Mac that uses these routines but violates the GPL would be
  124. |prosecuted swiftly and painfully.
  125.  
  126. Um, simply using GNU[*] code on a Mac does NOT violate the GPL.  The
  127. political position that GNU has taken is just that -- a political
  128. position.  There is nothing in the GPL that forbids GNU code to be
  129. used for Macintosh products.  Period.  RMS[**] and GNU do, however, ask
  130. that you boycott Apple's products [even to the point of developing any
  131. code for them] because of Apple's coporate behaviour vis-a-vis look
  132. and feel lawsuits.
  133.  
  134. So David, feel free to use and recommend the GNU regexp library to
  135. Macintosh programmers if you don't agree with the position that has
  136. been taken by RMS and GNU.
  137.  
  138.                         Reid
  139.  
  140. [*]  GNU = Gnu's Not Unix
  141. [**] RMS = Richard M. Stallman [sp?]
  142. - --
  143. Reid Ellis                                            
  144. rae@utcs.utoronto.ca        ||           rae@Alias.com
  145. CDA0610@applelink.apple.com ||  +1 416 362 9181 [work]
  146.  
  147. +++++++++++++++++++++++++++
  148.  
  149. From: dougm@cns.caltech.edu (Doug McNaught)
  150. Date: 9 Oct 92 21:48:55
  151. Organization: California Institute of Technology
  152.  
  153. In article <1992Oct9.191133.16952@alias.com> Reid Ellis <rae@Alias.com> writes:
  154.  
  155.    David Spencer <spencer@panix.com> writes:
  156.    |The gnu regular expression library is at prep.ai.mit. ... The separate
  157.    |regex library is called beta, but it's an extended and rationalized
  158.    |version of the grep regex code.
  159.  
  160.    Randal L. Schwartz <merlyn@ora.com> writes:
  161.    |Remember of course that this code is subject to the GNU Public
  162.    |License.  And because of RMS's opinions about Apple, you can bet that
  163.    |code for a Mac that uses these routines but violates the GPL would be
  164.    |prosecuted swiftly and painfully.
  165.  
  166.    Um, simply using GNU[*] code on a Mac does NOT violate the GPL.  The
  167.    political position that GNU has taken is just that -- a political
  168.    position.  There is nothing in the GPL that forbids GNU code to be
  169.    used for Macintosh products.  Period.  RMS[**] and GNU do, however, ask
  170.    that you boycott Apple's products [even to the point of developing any
  171.    code for them] because of Apple's coporate behaviour vis-a-vis look
  172.    and feel lawsuits.
  173.  
  174.   Using GNU code on a Mac doesn't in itself violate the GPL, correct.
  175. Randal's point is that code that does violate the GPL (as in, you
  176. release the binary but refuse to make the source freely available)
  177. would probably be more likely to attract a suit due to the FSF's
  178. position.
  179.  
  180.    So David, feel free to use and recommend the GNU regexp library to
  181.    Macintosh programmers if you don't agree with the position that has
  182.    been taken by RMS and GNU.
  183.  
  184.   As long as source is freely available, there is no violation. 
  185. - -doug
  186. - --
  187. Doug McNaught              |"Sadder still to watch it die/ Then never to have
  188. dougm@cns.caltech.edu      | known it/ For you, the blind who once could see/
  189. doug@midget.towson.edu     | The bell tolls for thee..." --Neil Peart
  190.   Nobody approves my opinions! Not even me, sometimes. Read at your own risk.
  191.  
  192. ---------------------------
  193.  
  194. From: olson@groucho.wi.edu (Eric K. Olson)
  195. Subject: Another Sound Manager Question (recording on PB)
  196. Organization: Whitehead Institute for Biomedical Research
  197. Date: Tue, 6 Oct 1992 18:04:58 GMT
  198.  
  199. I've been trying to get SPBRecordToFile() to do its thing for me,
  200. on a PowerBook 170, running 7.0.1 + TuneUp 1.1.1, without too much
  201. luck.  Here's what I'm doing (schematically):
  202.  
  203.     - Opening a data file (fsRdWrPerm).
  204.     - Opening the default sound device with siWritePermission.
  205.     - Getting the sample rate, sample size, number of channels,
  206.         and compression type from SPBGetDeviceInfo().
  207.     - Calling SetupAIFFHeader with the information received from
  208.         SPBGetDeviceInfo(), the file refnum, and a buffer
  209.         length (which is fixed at 64K).
  210.     - Calling SPBRecordToFile() with the file refnum, a SPB, and
  211.         the async flag set to FALSE.  The SPB has only
  212.         the inRefNum and the count fields set to non-zero
  213.         values (and the count field is set to 64K).
  214.     - Closing the data file.
  215.     - Closing the sound device.
  216.  
  217. I've looked at the info returned from SPBGetDeviceInfo():  it is all
  218. very normal, 8 bits/sample, 'NONE' compression, one channel.
  219.  
  220. When I play back with SndStartFilePlay() I hear that the file
  221. has the sound in it, but with a LOT of very gravelly noise on top of it.
  222.  
  223. Other things I've tried that work:
  224.  
  225.     - Playing sound files recorded with SndRecordToFile() with
  226.         the _same_ playback routine as above
  227.     - Recording and playing in memory using SPBSetupSndHeader()
  228.  
  229. I tried opening a sound channel before recording (not that it should
  230. matter), but that didn't change anything.  I think that the playback
  231. routine is OK, since it works with files recorded via
  232. SndRecordToFile() (the routine that displays the recording dialog).  I
  233. looked at the AIFF file and it seems to be in the correct format.  I
  234. suspect that the actual samples being recorded are corrupted somehow
  235. before being written to the disk.  Why does SndRecordToFile() work
  236. when my routine fails?  Is the PowerBook actually unable to record
  237. directly to disk (and is SndRecordToFile() not going directly to
  238. disk, but faking it by going to memory first)?
  239.  
  240. I also noticed that the 'qual' and 'chac' selectors don't work in
  241. SPBGetDeviceInfo().  Strange....
  242.  
  243. Any Ideas?
  244.  
  245. Thanks!
  246.  
  247. - -Eric
  248.  
  249.  
  250. - -- 
  251. Eric K. Olson
  252. Whitehead Institute for Biomedical Research
  253. 9 Cambridge Center, Cambridge, MA     02142
  254. olson@genome.wi.edu         (617) 258-5572
  255.  
  256. +++++++++++++++++++++++++++
  257.  
  258. From: olson@genome.wi.edu (Eric K. Olson)
  259. Date: 8 Oct 92 17:19:59 GMT
  260. Organization: Whitehead Institute for Biomedical Research
  261.  
  262. In article <1992Oct6.180458.15224@genome.wi.edu> I (Eric K. Olson) write:
  263. >I've been trying to get SPBRecordToFile() to do its thing for me,
  264. >on a PowerBook 170, running 7.0.1 + TuneUp 1.1.1, without too much
  265. >luck.  Here's what I'm doing (schematically):
  266. > [...]
  267. >When I play back with SndStartFilePlay() I hear that the file
  268. >has the sound in it, but with a LOT of very gravelly noise on top of it.
  269.  
  270. Well, I found the answer to this question after a lot of trial and error.
  271. It turns out that AIFF files expect the sound data to be in two's-complement
  272. format, so one has to turn that on (SetDeviceInfo('twos'...)) in order
  273. to record directly to an AIFF file.  The gravelly noise is a result of
  274. the sign bit being interpreted as a place value of 128.
  275.  
  276. Also, although the 'qual' selector doesn't work with GetDeviceInfo(),
  277. it does work with SetDeviceInfo().  You can set it to 'good' ('MAC6' compression),
  278. 'betr' ('MAC3' compression), or 'best' ('NONE' compression).  Setting the
  279. compression directly seems to always return an error.
  280.  
  281. Still don't know why the 'chac' selector fails.
  282.  
  283. So it would seem that you are supposed to set the 'qual' first, then
  284. muck with other settings later.
  285.  
  286. NEW QUESTION: Can I use 11 kHz (or lower) sampling rate with 'good'
  287. 'qual' ('MAC6' compression)?
  288.  
  289. Anybody else playing with this?
  290.  
  291. - -Eric
  292.  
  293.  
  294. - -- 
  295. Eric K. Olson
  296. Whitehead Institute for Biomedical Research
  297. 9 Cambridge Center, Cambridge, MA     02142
  298. olson@genome.wi.edu         (617) 258-5572
  299.  
  300. +++++++++++++++++++++++++++
  301.  
  302. From: REEKES@applelink.apple.com (Jim Reekes)
  303. Date: 9 Oct 92 21:08:46 GMT
  304. Organization: Apple Computer, Inc.
  305.  
  306. In article <1992Oct8.171959.6433@genome.wi.edu>, olson@genome.wi.edu (Eric
  307. K. Olson) wrote:
  308. > In article <1992Oct6.180458.15224@genome.wi.edu> I (Eric K. Olson) write:
  309. > >I've been trying to get SPBRecordToFile() to do its thing for me,
  310. > >on a PowerBook 170, running 7.0.1 + TuneUp 1.1.1, without too much
  311. > >luck.  Here's what I'm doing (schematically):
  312. > > [...]
  313. > >When I play back with SndStartFilePlay() I hear that the file
  314. > >has the sound in it, but with a LOT of very gravelly noise on top of it.
  315. > Well, I found the answer to this question after a lot of trial and error.
  316. > It turns out that AIFF files expect the sound data to be in two's-complement
  317. > format, so one has to turn that on (SetDeviceInfo('twos'...)) in order
  318. > to record directly to an AIFF file.  The gravelly noise is a result of
  319. > the sign bit being interpreted as a place value of 128.
  320. > Also, although the 'qual' selector doesn't work with GetDeviceInfo(),
  321. > it does work with SetDeviceInfo().  You can set it to 'good' ('MAC6' compression),
  322. > 'betr' ('MAC3' compression), or 'best' ('NONE' compression).  Setting the
  323. > compression directly seems to always return an error.
  324. > Still don't know why the 'chac' selector fails.
  325. > So it would seem that you are supposed to set the 'qual' first, then
  326. > muck with other settings later.
  327. > NEW QUESTION: Can I use 11 kHz (or lower) sampling rate with 'good'
  328. > 'qual' ('MAC6' compression)?
  329.  
  330. Nope.  The current MACE assumes a sample rate of 22kHz.  Also, don't assume
  331. that "good" means MACE 3:1.  It can be anyone of your sound input driver's
  332. idea of what good means.  To them it may mean a lower sampling rate, a
  333. different compression (i.e. Farallon 4:1), or a different filtering.
  334.  
  335. - -----------------------------------------------------------------------
  336. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  337.                              |          Sound Manager Expert
  338. Apple Computer, Inc.         | RAll opinions expressed are mine, and do
  339. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  340. Cupertino, CA 95014          |       employer, Apple Computer Inc.S
  341.  
  342. ---------------------------
  343.  
  344. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  345. Subject: Deferred Tasks - What can I do?
  346. Organization: University of Illinois at Urbana
  347. Date: Wed, 7 Oct 1992 00:18:05 GMT
  348.  
  349. Simple question:
  350.  
  351. Can I move memory (e.g. call NewPtr) in a deferred task, i.e. one I
  352. installed with DTInstall?
  353.  
  354. pr
  355. - -- 
  356. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  357. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  358. System manager - Cognitive Science Group, Beckman Institute, UIUC
  359. Internet: resnick@cogsci.uiuc.edu
  360.  
  361. +++++++++++++++++++++++++++
  362.  
  363. From: wuertz@tik.ethz.ch (Andreas Wuertz)
  364. Date: 7 Oct 92 09:58:30 GMT
  365. Organization: Federal Institute of Technology
  366.  
  367. In article <Bvq666.MHH@news.cso.uiuc.edu> Pete Resnick,
  368. resnick@cogsci.uiuc.edu writes:
  369. >Simple question:
  370. >
  371. >Can I move memory (e.g. call NewPtr) in a deferred task, i.e. one I
  372. >installed with DTInstall?
  373.  
  374. Simple question, simple answer: Deferred tasks are defined as tasks that
  375. are too lengthy to execute as a direct response to an irq, so they're
  376. deferred to execution with irqs reenabled but just BEFORE returning to
  377. normal execution; so I'd say you CAN'T make calls to NewPtr a.s.o. But
  378. this is only MY opinion.
  379.  
  380. Andy (wuertz@tik.ethz.ch)
  381.  
  382. ========================================================================
  383. The only person who got all his work done by Friday was Robinson Crusoe.
  384. ========================================================================
  385.  
  386. +++++++++++++++++++++++++++
  387.  
  388. From: heksterb@cs.utwente.nl (Ben Hekster)
  389. Date: 7 Oct 92 10:39:50 GMT
  390. Organization: University of Twente, Dept. of Computer Science
  391.  
  392. In article <Bvq666.MHH@news.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  393. >Can I move memory (e.g. call NewPtr) in a deferred task, i.e. one I
  394. >installed with DTInstall?
  395.  
  396. I would say, no.  The only difference between a VBL and a Deferred Task
  397. is that a VBL task executes while the processor interrupts are being
  398. serviced, and a Deferred Task is executed after processor interrupts
  399. are reenabled.  This is so that you don't get a System Error when
  400. another interrupt arrives while you are still executing a (lengthy)
  401. task.  For all other practical purposes, you are still executing at
  402. interrupt time-- i.e., the heap may be in an inconsistent state, etc.
  403.  
  404. - -- 
  405. Ben `Hackster' Hekster        | "He bides his time and thinks,
  406. heksterb@cs.utwente.nl        |  'There must be more to life than this!'"
  407.  
  408. +++++++++++++++++++++++++++
  409.  
  410. From: grobbins@Apple.COM (Grobbins)
  411. Date: 7 Oct 92 23:59:07 GMT
  412. Organization: Apple Computer Inc., Cupertino, CA
  413.  
  414. In article <Bvq666.MHH@news.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  415. >Can I move memory (e.g. call NewPtr) in a deferred task, i.e. one I
  416. >installed with DTInstall?
  417.  
  418. No, since deferred tasks must adhere to interrupt-time restrictions.
  419. This is discussed in Jim Luther's DTM tech note (#320, for those
  420. who still believe in numbers.)  I'll paste the relevant portion
  421. below.
  422.  
  423. Grobbins            grobbins@apple.com
  424.  
  425. Usual disclaimers apply.
  426.  
  427. - ---
  428.  
  429. from Tech Note 320, "Deferred Task Traps, Truths, and Tips":
  430.  
  431. How and when the Deferred Task Manager calls deferred tasks
  432.  
  433. Since understanding how something works usually answers most questions about
  434. it, this note gives a complete explanation of how deferred tasks get called.
  435.  I'll start with the occurrence of an interrupt.
  436.  
  437. When an interrupt occurs, the processor stops executing the current program
  438. and control is passed to the Macintosh's primary interrupt handler.  The
  439. primary interrupt handler saves registers A0-A3/D0-D3 and then decides what
  440. secondary interrupt handler to dispatch to.  If the system has an MMU, was
  441. booted 24-bit mode but is presently in 32-bit mode, then the MMU state is
  442. saved and the MMU is switched to 24-bit mode.  If the system has power
  443. management (i.e., is a portable Macintosh) and is in slow speed, the speed
  444. is saved and is then switched to full speed.  Control is then passed to the
  445. secondary interrupt handler which handles the interrupt.
  446.  
  447. When control returns to the primary interrupt handler from the secondary
  448. interrupt handler, the primary interrupt handler checks to see if there are
  449. any deferred tasks in the deferred task queue and checks to see if upon exit
  450. of this interrupt, the processor priority level will be returned to 0.  If
  451. both conditions are true, control is passed to the Deferred Task Manager to
  452. execute those tasks.
  453.  
  454. The Deferred Task Manager checks to see if a deferred task is already
  455. active; if so, the Deferred Task Manager exits.  Otherwise, one by one, each
  456. deferred task in the deferred task queue is dequeued, and then called with
  457. register A1 containing dtParm from the DeferredTask record and the processor
  458. priority level is set to 0 (i.e., all interrupts are enabled).  When all
  459. deferred tasks have been dequeued and called, control is returned to the
  460. primary interrupt handler.
  461.  
  462. When control returns to primary interrupt handler from the Deferred Task
  463. Manager, the primary interrupt handler restores the MMU state and speed if
  464. necessary and then restores registers A0-A3/D0-D3.  Then the primary
  465. interrupt handler returns control to the program executing before the
  466. interrupt occurred.
  467.  
  468. With that explanation out of the way, here are a few things that may or may
  469. not be obvious.
  470.  
  471. Deferred tasks are interrupt time code
  472.  
  473. That is, deferred tasks are run as a result of an interrupt.  A deferred
  474. task must follow many of the same rules as a interrupt handler.  Here's a
  475. warning to go along with the material in the Deferred Task Manager chapter
  476. of Inside Macintosh Volume V.
  477.  
  478. Warning:    Deferred tasks are executed at the interrupt level and must
  479. preserve all registers other than A0-A3 and D0-D3.  Your deferred task must
  480. not make any calls to the Memory Manager, directly or indirectly, and can't
  481. depend on handles to unlocked blocks being valid.  If it uses application
  482. globals, it must also ensure that register A5 contains the address of the
  483. boundary between the application globals and the application parameters; for
  484. details, see Setting and Restoring the A5 Register in the Memory Management
  485. chapter of Inside Macintosh Volume VI.  Your deferred task should avoid
  486. accessing a low-memory variables or calling a trap that would access one
  487. because while MultiFinder@ or System 7 is running, application low-memory
  488. global variables are being swapped in and out. 
  489.  
  490. Deferred tasks can be interrupted
  491.  
  492. That's the purpose of using deferred tasks - to let interrupt driven
  493. processes keep running while your deferred task completes a lengthy task. 
  494. This means that your deferred task must be interruptible-that is, you should
  495. not have to do anything such as timing-critical hardware access that can get
  496. screwed up with interrupts on.
  497.  
  498. If the interrupt handler that installs the deferred task can be called again
  499. while that deferred task is executing, then you also need to make sure the
  500. way the interrupt handler and the deferred task code work together is
  501. reentrant.  For example, the interrupt code should not modify a data buffer
  502. that the deferred task is processing.
  503.  
  504. Deferred tasks are not prioritized
  505.  
  506. Deferred tasks are executed in the order they were added to the deferred
  507. task queue no matter what interrupt level the code installing the task may
  508. have been running at.
  509.  
  510. Deferred task latency
  511.  
  512. There may be significant latency incurred between installing a deferred task
  513. with DTInstall and when that task is performed.  This time is not
  514. deterministic and cannot be controlled.  Real-time response cannot be
  515. guaranteed on Macintosh computers with or without the use of deferred tasks.
  516.  
  517. +++++++++++++++++++++++++++
  518.  
  519. From: REEKES@applelink.apple.com (Jim Reekes)
  520. Date: 8 Oct 92 19:32:34 GMT
  521. Organization: Apple Computer, Inc.
  522.  
  523. In article <1992Oct7.103950.26354@cs.utwente.nl>, heksterb@cs.utwente.nl
  524. (Ben Hekster) wrote:
  525. > In article <Bvq666.MHH@news.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  526. > >Can I move memory (e.g. call NewPtr) in a deferred task, i.e. one I
  527. > >installed with DTInstall?
  528. > I would say, no.  The only difference between a VBL and a Deferred Task
  529. > is that a VBL task executes while the processor interrupts are being
  530. > serviced, and a Deferred Task is executed after processor interrupts
  531. > are reenabled.  This is so that you don't get a System Error when
  532. > another interrupt arrives while you are still executing a (lengthy)
  533. > task.  For all other practical purposes, you are still executing at
  534. > interrupt time-- i.e., the heap may be in an inconsistent state, etc.
  535.  
  536. Both a VBL and a Deferred Task are considered interrupt code.  Neither
  537. can make calls to the toolbox, allocate memory, etc.
  538.  
  539. VBL tasks are executed with all interrupts enabled.  This allows anything
  540. to interrupt a VBL task.  The VBL manager will one run one VBL task at
  541. any given time, so a VBL cannot interrupt a VBL.
  542.  
  543. Deferred Tasks are documented in the recent Tech Note, and it explains
  544. the details of when and how they are executed.
  545.  
  546. Both a VBL and a Deferred Task are ran with processor interrupts enabled.
  547.  
  548. - -----------------------------------------------------------------------
  549. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  550.                              |          Sound Manager Expert
  551. Apple Computer, Inc.         | RAll opinions expressed are mine, and do
  552. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  553. Cupertino, CA 95014          |       employer, Apple Computer Inc.S
  554.  
  555. +++++++++++++++++++++++++++
  556.  
  557. From: Jeff E Mandel <mandel@tmc.tulane.edu>
  558. Organization: Tulane University School of Medicine
  559. Date: Thu, 8 Oct 1992 23:10:12 GMT
  560.  
  561. In article <REEKES-081092123045@90.10.20.67> Jim Reekes,
  562. REEKES@applelink.apple.com writes:
  563. >Both a VBL and a Deferred Task are considered interrupt code.  Neither
  564. >can make calls to the toolbox, allocate memory, etc.
  565. >
  566.  
  567. While I understand what you mean, this is not what you are saying. You
  568. cannot call anything which isn't reentrant, or which presumes that an
  569. unlocked block is where the handle says it is, etc., but that doesn't
  570. mean you can't call anything in the toolbox, or even allocate memory.
  571. There exist techniques whereby you can preallocate a private heap, for
  572. which you write all of the HeapZone functions, which can be made to
  573. function within the constraints of interrupt-driven code. Now, most folks
  574. don't need this, because usually interrupt-driven code does the same
  575. thing over and over again, and you can get by with just allocating a
  576. suitably large number of queue elements and managing a free list (like
  577. the nonpaged dynamic pool, for you VMS folks).  You can also do a a
  578. number of things which lead up to screen output from interrupt-driven
  579. code, but since it is a major pain to keep track of where things are,
  580. it's not worth the trouble (I know, I once wrote a preemptive
  581. dual-tasking executive which allowed me to simulataneously run a
  582. real-time controller and the user interface, except it bothered the users
  583. that it would draw graphs through the menus, and they'd subsequently be
  584. sucked back up into the menubar! (the graphs, not the users)).
  585.  
  586. Since I probably planted the idea in Pete's head about Deferred Tasks,
  587. the best thing I can suggest is to decide whether the blocks you need at
  588. interrupt time can be of a fixed size, or not. If not, you've got to
  589. write something that manages the memory you preallocate, and probably
  590. guard the code with a spinlock, as it may get reenterred. Plan on long
  591. sessions in MacsBug. If it can be of fixed size, then create two OS
  592. queues, one which contains a list of free blocks, and the other is used
  593. as your private event queue. It is possible to do this with only one
  594. queue (this is how the event queue works, but it doesn't permit you as
  595. much flexibility in priority handling).
  596.  
  597. Hope this helps,
  598.  
  599. Jeff E Mandel MD MS
  600. Associate Professor of Anesthesiology
  601. Tulane University School of Medicine
  602. New Orleans, LA
  603.  
  604. mandel@tmc.tulane.edu
  605.  
  606. +++++++++++++++++++++++++++
  607.  
  608. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  609. Date: 9 Oct 92 16:25:11 GMT
  610. Organization: University of Illinois at Urbana
  611.  
  612. Jeff E Mandel <mandel@tmc.tulane.edu> writes:
  613.  
  614. >Since I probably planted the idea in Pete's head about Deferred Tasks,
  615.  
  616. You did. :-)
  617.  
  618. >the best thing I can suggest is to decide whether the blocks you need at
  619. >interrupt time can be of a fixed size, or not.
  620.  
  621. They are fixed size in my case, and I will probably implement this
  622. using an private queue. The problem was that I didn't want to
  623. pre-allocate all of this memory since many of the blocks may never be
  624. used, but it shouldn't be too big a deal.
  625.  
  626. Thanks to everyone for the input.
  627.  
  628. pr
  629. - -- 
  630. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  631. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  632. System manager - Cognitive Science Group, Beckman Institute, UIUC
  633. Internet: resnick@cogsci.uiuc.edu
  634.  
  635. +++++++++++++++++++++++++++
  636.  
  637. From: REEKES@applelink.apple.com (Jim Reekes)
  638. Date: 9 Oct 92 21:05:30 GMT
  639. Organization: Apple Computer, Inc.
  640.  
  641. In article <1992Oct8.231012.1588@cs.tulane.edu>, mandel@tmc.tulane.edu
  642. (Jeff E Mandel) wrote:
  643. > In article <REEKES-081092123045@90.10.20.67> Jim Reekes,
  644. > REEKES@applelink.apple.com writes:
  645. > >Both a VBL and a Deferred Task are considered interrupt code.  Neither
  646. > >can make calls to the toolbox, allocate memory, etc.
  647. > >
  648. > While I understand what you mean, this is not what you are saying. You
  649. > cannot call anything which isn't reentrant, or which presumes that an
  650. > unlocked block is where the handle says it is, etc., but that doesn't
  651. > mean you can't call anything in the toolbox, or even allocate memory.
  652. > There exist techniques whereby you can preallocate a private heap, for
  653. > which you write all of the HeapZone functions, which can be made to
  654. > function within the constraints of interrupt-driven code. Now, most folks
  655. > don't need this, because usually interrupt-driven code does the same
  656. > thing over and over again, and you can get by with just allocating a
  657. > suitably large number of queue elements and managing a free list (like
  658. > the nonpaged dynamic pool, for you VMS folks).  You can also do a a
  659. > number of things which lead up to screen output from interrupt-driven
  660. > code, but since it is a major pain to keep track of where things are,
  661. > it's not worth the trouble (I know, I once wrote a preemptive
  662. > dual-tasking executive which allowed me to simulataneously run a
  663. > real-time controller and the user interface, except it bothered the users
  664. > that it would draw graphs through the menus, and they'd subsequently be
  665. > sucked back up into the menubar! (the graphs, not the users)).
  666. > Since I probably planted the idea in Pete's head about Deferred Tasks,
  667. > the best thing I can suggest is to decide whether the blocks you need at
  668. > interrupt time can be of a fixed size, or not. If not, you've got to
  669. > write something that manages the memory you preallocate, and probably
  670. > guard the code with a spinlock, as it may get reenterred. Plan on long
  671. > sessions in MacsBug. If it can be of fixed size, then create two OS
  672. > queues, one which contains a list of free blocks, and the other is used
  673. > as your private event queue. It is possible to do this with only one
  674. > queue (this is how the event queue works, but it doesn't permit you as
  675. > much flexibility in priority handling).
  676.  
  677. While you think you know what I mean, you really don't.  I was avoiding
  678. a long discussion about all the hows and whys.  It's much more truthful to
  679. state that you cannot call any toolbox calls.  There are few that can be,
  680. and Apple doesn't document them because we couldn't.  The list of
  681. exceptions
  682. is far too great.  Besides, the movement is to avoid interrupt code
  683. entirely.
  684.  
  685. Here's a little more data about the issue.  Not only is allocating
  686. or moving blocks in the heap illegal during interrupt, you cannot call
  687. routines that are non-reentrant.  This just about excludes all of the
  688. toolbox.  The Mac toolbox uses lots of low memory globals, much more than
  689. that Inside Mac ever talks about.  Because of this global state
  690. information,
  691. you cannot call a routine that depends on such a globals.
  692.  
  693. Furthermore, some of these globals are swapped during a tasks context.  
  694. For
  695. example, FrontWindow refers to the global WindowList.  This global is
  696. swapped for
  697. the current process.  Even thou FrontWindow doesn't move or allocate
  698. memory,
  699. nor does it have a reentrancy problem, but it cannot be called a interrupt
  700. level.
  701.  
  702. Because of this last issue, things get really sticky.  We don't have a list
  703. of which globals are swapped for a task, and it changes for the many
  704. releases
  705. of the MultiFinder/Process Manager.  This is part of the reason we cannot
  706. document entirely which calls cannot be called at interrupt level.  We do
  707. attempt to provide a list of the ones we promise to be safe, such as
  708. StripAddress.
  709.  
  710. - -----------------------------------------------------------------------
  711. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  712.                              |          Sound Manager Expert
  713. Apple Computer, Inc.         | RAll opinions expressed are mine, and do
  714. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  715. Cupertino, CA 95014          |       employer, Apple Computer Inc.S
  716.  
  717. ---------------------------
  718.  
  719. From: udmorrow@mcs.drexel.edu (Daniel Morrow)
  720. Subject: problem with my dialog filter
  721. Date: 7 Oct 92 16:48:27 GMT
  722. Organization: Drexel University
  723.  
  724. Basically, all I'm doing is checking an edit text field in my
  725. dialog to see if there is anything in it. If not I dim out the
  726. OK button, if so, the OK button becomes active again.
  727.  
  728. Anyway, this part works. The part that doesn't work is checking
  729. for carriage returns when the OK button is enabled.
  730.  
  731. I do the following in my filter now:
  732.     Set itemHit to the id of the OK button
  733.     Set event.what to mouseDown.
  734.     Set event.where to a point inside the OK button
  735.     and I do call LocalToGlobal on that point.
  736.     And lastly I set MyFilter to FALSE so ModalDialog knows
  737.     to handle the event.
  738.  
  739. Am I missing something here?
  740.  
  741. Please help.
  742.  
  743. Thanks.
  744. - -Dan.
  745. udmorrow@mcs.drexel.edu
  746.  
  747. +++++++++++++++++++++++++++
  748.  
  749. From: Ted Lowery <tbl@rock.concert.net>
  750. Organization: MacSolutions
  751. Date: Thu, 8 Oct 1992 16:46:57 GMT
  752.  
  753. Try this...
  754.  
  755. void    FlashButton(int ButtonID);
  756. /*  just flash the button, visual only  */
  757. void    FlashButton(int ButtonID)
  758. {
  759.     Rect        itemRect;
  760.     long        ticksLater;
  761.     
  762.     itemRect = GetDRect (ButtonID);
  763.     InsetRect (&itemRect, 1, 1);
  764.     InvertRoundRect (&itemRect, 8, 8);
  765.     ticksLater = TickCount() + 10;            /* wait a sixth second...I don't know */
  766.     while (TickCount() < ticksLater) ;        /* if that is standard, I just
  767. guessed  */
  768.     InvertRoundRect (&itemRect, 8, 8);
  769. }
  770.  
  771.  
  772.  
  773. pascal Boolean charFilter(DialogPtr theDialog,EventRecord *theEvent,short
  774. *itemHit);
  775. pascal Boolean charFilter(DialogPtr theDialog,EventRecord *theEvent,short
  776. *itemHit)
  777. {
  778.     Str255    theText;
  779.     if (theEvent->what != keyDown) return(FALSE);  /* only looking for key
  780. downs */
  781.     
  782.     switch ((theEvent->message) & charCodeMask) {
  783.         case 0x0D:
  784.         case 0x03:
  785.             *itemHit = OKButton;                    /* basically tell ModalDialog we handled the
  786. */
  787.             FlashButton(OKButton);            /*  keydown, but now there is an itemHit that
  788. */
  789.             return(TRUE);                                         /* than ModalDialog gets to handle  */
  790.             break;
  791.  
  792.         default:
  793.             break;
  794.         }
  795. }
  796.  
  797. Hope this helps.
  798.  
  799. Ted
  800. tbl@rock.concert.net
  801.  
  802. +++++++++++++++++++++++++++
  803.  
  804. From: mxmora@unix.SRI.COM (Matt Mora)
  805. Date: 9 Oct 92 00:28:01 GMT
  806. Organization: SRI International, Menlo Park, California
  807.  
  808. In article <D88-JWA.92Oct8205414@byse.nada.kth.se> d88-jwa@byse.nada.kth.se (Jon Wtte) writes:
  809.  
  810. >You should use _Delay, which is a system call that does just
  811. >this, but also calls SystemTask. It might also do other
  812. >things in the future. Doing only this is really bad, since
  813. >there may be drivers that need time often.
  814.  
  815. I would hate to disagree with Jon but I don't think delay calls systemtask.
  816. I think it just stuffs LMG "ticks" into d0 , adds the delay amount and loops
  817. until "ticks" is bigger than d0. 
  818.  
  819. I created my own Delay function that calls WNE with the sleep at 1 tick. It 
  820. works ok.
  821.  
  822.  
  823. Matt
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831. - -- 
  832. ___________________________________________________________
  833. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  834. SRI International           |  my unix  mxmora@unix.sri.com
  835. ___________________________________________________________
  836.  
  837. +++++++++++++++++++++++++++
  838.  
  839. Date: 9 Oct 92 09:05:55 GMT
  840. Organization: Royal Institute of Technology, Stockholm, Sweden
  841.  
  842. In article <39359@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  843.  
  844.    >You should use _Delay, which is a system call that does just
  845.    >this, but also calls SystemTask. It might also do other
  846.    >things in the future. Doing only this is really bad, since
  847.    >there may be drivers that need time often.
  848.  
  849.    I would hate to disagree with Jon but I don't think delay calls systemtask.
  850.    I think it just stuffs LMG "ticks" into d0 , adds the delay amount and loops
  851.    until "ticks" is bigger than d0. 
  852.  
  853. Okay, but the "might do other things in the future" still
  854. holds :-) (Actually, it also sets the status register;
  855. interrupt level one might think)
  856.  
  857.    I created my own Delay function that calls WNE with the sleep at 1 tick. It 
  858.    works ok.
  859.  
  860. As long as you don4t get update, or suspend, or ... events
  861. while in the delay loop. At least you can mask those out;
  862. AppleEvents, however, can NEVER be masked out, so you had
  863. better be prepared handle them whenever you call WaitNextEvent.
  864.  
  865. - -- 
  866. Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069
  867.  
  868. "From now on, I think I'll re-label the EQ on the
  869.  desk as Fizz and Wobble, rather than HF and LF."
  870.  
  871. +++++++++++++++++++++++++++
  872.  
  873. From: wuertz@tik.ethz.ch (Andreas Wuertz)
  874. Date: 9 Oct 92 13:34:30 GMT
  875. Organization: Federal Institute of Technology
  876.  
  877. In article <1992Oct7.164827.26670@mcs.drexel.edu> Daniel Morrow,
  878. udmorrow@mcs.drexel.edu writes:
  879. >    Set itemHit to the id of the OK button
  880. >    Set event.what to mouseDown.
  881. >    Set event.where to a point inside the OK button
  882. >    and I do call LocalToGlobal on that point.
  883. >    And lastly I set MyFilter to FALSE so ModalDialog knows
  884. >    to handle the event.
  885.  
  886. How about setting MyFilter to TRUE, so ModalDialog knows YOU handled the
  887. event and doesn't fiddle around with itemHit anymore?
  888.  
  889. In article <1992Oct8.164657.26841@nrtpa038.bnr.ca> Ted Lowery,
  890. tbl@rock.concert.net writes:
  891. >void    FlashButton(int ButtonID);
  892. >/*  just flash the button, visual only  */
  893. >void    FlashButton(int ButtonID)
  894. >{
  895. >    Rect        itemRect;
  896. >    long        ticksLater;
  897. >    
  898. >    itemRect = GetDRect (ButtonID);
  899. >    InsetRect (&itemRect, 1, 1);
  900. >    InvertRoundRect (&itemRect, 8, 8);
  901. >    ticksLater = TickCount() + 10;            /* wait a sixth second...I don't know
  902. */
  903. >    while (TickCount() < ticksLater) ;        /* if that is standard, I just
  904. >guessed  */
  905. >    InvertRoundRect (&itemRect, 8, 8);
  906. >}
  907.  
  908. I don't believe this! How about this one:
  909. void    FlashButton(DialogPtr theDialog, int buttonID)
  910. /* This will also work in System 9.5 (known as 'Violett') where buttons
  911.    become dark red with greenish dots when the are clicked */
  912. {
  913. GetDItem(theDialog, buttonID, &itemType, &itemHandle, itemBox);
  914. HiliteControl(itemHandle, 1);
  915. Delay(10);
  916. HiliteControl(itemHandle, 0); /* that's it! */
  917. }
  918.  
  919. By the way:
  920. Delay causes the system to wait for the number of ticks (sixtieths of a
  921. second)
  922. specified by numTicks, and returns in finalTicks the total number of
  923. ticks from
  924. system startup to the end of the delay.
  925.  
  926. Warning:  Don't rely on the duration of the delay being exact; it will
  927. usually
  928.           be accurate to within one tick, but may be off by more than
  929. that.
  930.           The Delay procedure enables all interrupts and checks the tick
  931. count
  932.           that's incremented during the vertical retrace interrupt;
  933. however,
  934.           it's possible for this interrupt to be disabled by other
  935. interrupts,
  936.           in which case the duration of the delay will not be exactly
  937. what you
  938.           requested.
  939.  
  940. Assembly-language note:??On exit from this procedure, register D0
  941. contains the
  942.                          value of the global variable Ticks as measured
  943. at the
  944.                          end of the delay.
  945.  
  946. Andy (wuertz@tik.ethz.ch)
  947.  
  948. ========================================================================
  949. The only person who got all his work done by Friday was Robinson Crusoe.
  950. ========================================================================
  951.  
  952. ---------------------------
  953.  
  954. From: yjc@po.cwru.edu (Jerome Chan)
  955. Subject: Apple Events! How to locate a service?
  956. Date: 7 Oct 92 19:33:16 GMT
  957. Organization: The Tofu Society of Singapore
  958.  
  959.  
  960.   Apple Events is a cool way to communicate between various applications.
  961. However, I noticed a drawback. It doesn't have a services directory.
  962. Everytime there is a need to locate a particular application
  963. service/server, I've got to fiddle around with the PPC thingies. If the
  964. application/server providing the service is not running, there is no way my
  965. application can find out where the server/application is located, launch it
  966. and continue (with the user's consent of course!).
  967.  
  968.   A services directory (sd) would be a nice thing to have. An application
  969. would  register with the sd, indicating if it provides local and/or global
  970. services. The sd would then inform all other sd's on the AppleTalk net of
  971. this new addition if global services are provided. When an application
  972. requires to connect to a particulat service, it would query the sd to find
  973. the correct address. The sd could also keep a record of previously active
  974. services and their locations and launch them (via AEs to the
  975. approperiate(spelling?) finder) if requested
  976.  
  977.   Is there something else available/comming soon that would provide this
  978. functionality? Are the software people at Apple going to provide something
  979. like this in the next system release? Anyone know? Am I wasting my time?
  980.  
  981.   Maybe it's because it's four o'clock in the afternoon.
  982.  
  983.  
  984.  
  985. - ---
  986.  The Evil Tofu
  987.  
  988. +++++++++++++++++++++++++++
  989.  
  990. From: ross@bnr.ca (Ross Brown)
  991. Date: 8 Oct 92 15:56:41 GMT
  992. Organization: Bell-Northern Research Ltd.
  993.  
  994. In article <yjc-071092151355@b61539.student.cwru.edu> yjc@po.cwru.edu (Jerome
  995. Chan) writes:
  996. >
  997. >  Apple Events is a cool way to communicate between various applications.
  998. >However, I noticed a drawback. It doesn't have a services directory.
  999. >Everytime there is a need to locate a particular application
  1000. >service/server, I've got to fiddle around with the PPC thingies. If the
  1001. >application/server providing the service is not running, there is no way my
  1002. >application can find out where the server/application is located, launch it
  1003. >and continue (with the user's consent of course!).
  1004.  
  1005. Well, there's no sure-fire programmatic way of doing it in System 7, but if
  1006. your local program knows that the remote application/server has a certain PPC
  1007. port name, or a certain NBP entity type alias assigned by PPC, and your machine
  1008. has an alias to the application/server somewhere on its disk, then everything
  1009. you describe can be done by a program on your machine without alerting the
  1010. user, with the requisite combination of IPCListPorts, StartSecureSession, and
  1011. remote Finder AEs.  This amounts to implementing a services directory on the
  1012. *client* machine rather than the *server*, which may not be what you want, but
  1013. it works.
  1014.  
  1015. A directory server capability of the sort you describe could be built into the
  1016. client program on the standard of signatures.  PPC allows servers to register
  1017. themselves on the network on a creator/type basis, so client programs can use
  1018. signatures to check whether a server is running.  The desktop database has a
  1019. call (PBDTGetAPPL) which can find the location of the server program given its
  1020. signature.  Once your client program mounts the remote volume where the server
  1021. program lives, you can use PBDTGetAPPL with ioVRefNum referring to the remote
  1022. volume.  The resulting value in ioAPPLParID gives you the exact directory,
  1023. which you can easily search to find the server program.  Make an alias, send a
  1024. 'sope' AE to the remote Finder, and voila.
  1025.  
  1026. I'd like to see the result, once you get it working!
  1027.  
  1028. ==============================================================================
  1029. Ross Brown, Dept. 7C22  < Bell-Northern Research     >  Just the facts, ma'am.
  1030. Advisor, Telemgmt Svcs  < P. O. Box 3511, Station C  >  We don't care whose
  1031. ross@bnr.ca             < Ottawa, ON, Canada K1Y 4H7 >  opinions yours aren't.
  1032. ==============================================================================
  1033.  
  1034. +++++++++++++++++++++++++++
  1035.  
  1036. From: cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton)
  1037. Date: 8 Oct 1992 21:00:25 GMT
  1038. Organization: Academic Computing
  1039.  
  1040. In article <D88-JWA.92Oct8204556@byse.nada.kth.se>,
  1041. d88-jwa@byse.nada.kth.se (Jon Wtte) wrote:
  1042. > And still we don't have a good service dictionary in the system.
  1043. > Anyone care to try and position the HLE and the AE in the OSI
  1044. > stack? PPC should be at the same level as TCP, i.e. level 3 ?
  1045. > (starting at 0)
  1046.  
  1047. AE.... Session level.
  1048.  
  1049. - --_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  1050. Chuck Shotton                      |    
  1051. Ass't Director, Academic Computing |       "This space for rent."
  1052. UT Health Science Center Houston   |  
  1053. cshotton@oac.hsc.uth.tmc.edu       |         
  1054. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  1055.  
  1056. +++++++++++++++++++++++++++
  1057.  
  1058. Organization: Royal Institute of Technology, Stockholm, Sweden
  1059. Date: Thu, 8 Oct 1992 19:45:56 GMT
  1060.  
  1061. > ross@bnr.ca (Ross Brown) writes:
  1062.  
  1063. > Well, there's no sure-fire programmatic way of doing it in System 7,
  1064. > but if your local program knows that the remote application/server has
  1065. > a certain PPC port name, or a certain NBP entity type alias assigned
  1066.  
  1067. Well, everything would be nicer if you could actually USE the
  1068. documented-but-not-implemented type/creator port format. Now
  1069. you can use the not-documented-but-I-hope-stable format <creator>ep01
  1070. (ep == Event Port ?)
  1071.  
  1072. > somewhere on its disk, then everything you describe can be done by a
  1073. > program on your machine without alerting the user, with the requisite
  1074. > combination of IPCListPorts, StartSecureSession, and remote Finder
  1075.  
  1076. Nope; you still have to use program linking to establish an
  1077. AppleEvent channel (username & password) - We work around that
  1078. using AutoGuest INIT, but that's REALLY skanky (we should, at
  1079. least, use the library version)
  1080.  
  1081. Does the finder listen to remote events? I thought not. Therefore
  1082. you have to write a small system extension (background application)
  1083. that listens for specific AppleEvents and relays them to the local
  1084. finder. Talk about security hole :-)
  1085.  
  1086. According to Really Heavy Names (i.e. the guys who did it) this
  1087. is not easily solvable, since the AE manager lies on top of the
  1088. HLE manager, which lies on top of PPC. If AE lied directly on
  1089. top of PPC, one could conceive of specific attributes for name
  1090. and password; however, the HLE manager known nothing about what
  1091. you send through it.
  1092.  
  1093. And still we don't have a good service dictionary in the system.
  1094. Anyone care to try and position the HLE and the AE in the OSI
  1095. stack? PPC should be at the same level as TCP, i.e. level 3 ?
  1096. (starting at 0)
  1097.  
  1098. Cheers,
  1099.  
  1100.                         / h+
  1101.  
  1102. - -- 
  1103. Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069
  1104.  
  1105. "From now on, I think I'll re-label the EQ on the
  1106.  desk as Fizz and Wobble, rather than HF and LF."
  1107.  
  1108. +++++++++++++++++++++++++++
  1109.  
  1110. From: ross@bnr.ca (Ross Brown)
  1111. Organization: Bell-Northern Research Ltd.
  1112. Date: Fri, 9 Oct 92 20:33:08 GMT
  1113.  
  1114. In article <D88-JWA.92Oct8204556@byse.nada.kth.se> d88-jwa@byse.nada.kth.se
  1115. (Jon Wtte) writes:
  1116. >[stuff deleted]
  1117. >Does the finder listen to remote events? I thought not. Therefore
  1118. >you have to write a small system extension (background application)
  1119. >that listens for specific AppleEvents and relays them to the local
  1120. >finder. Talk about security hole :-)
  1121.  
  1122. Does Finder listen to remote events?  It does for me.  Check out Jon Pugh's
  1123. FinderEvents stack.  In the description of the Open Selection and Print
  1124. Selection events, he mentions that these are the only ones you can fire at a
  1125. remote Finder, and by Jove, it works.
  1126.  
  1127. You may have noticed that Finder always appears in the list of programs when
  1128. you are poking around the network in the PPC Browser.  In fact, there's no
  1129. Sharing dialog for Finder, so you can't tell it *not* to listen to remote
  1130. events... 'sope' and 'spri', at least.
  1131.  
  1132. ==============================================================================
  1133. Ross Brown, Dept. 7C22  < Bell-Northern Research     >  Just the facts, ma'am.
  1134. Advisor, Telemgmt Svcs  < P. O. Box 3511, Station C  >  We don't care whose
  1135. ross@bnr.ca             < Ottawa, ON, Canada K1Y 4H7 >  opinions yours aren't.
  1136. ==============================================================================
  1137.  
  1138.  
  1139. ---------------------------
  1140.  
  1141. End of C.S.M.P. Digest
  1142. **********************
  1143.